package com.easy.neo4j.entry.bus;

import lombok.Data;
import org.springframework.data.neo4j.core.schema.GeneratedValue;
import org.springframework.data.neo4j.core.schema.Id;
import org.springframework.data.neo4j.core.schema.Node;
import org.springframework.data.neo4j.core.schema.Property;

import java.io.Serializable;
import java.util.*;

/**
 * @author: CoolPro
 * @Desc: 车站
 * @create: 2024-02-26 19:13
 **/
@Node(labels = "BusSite1")
@Data
public class Site implements Serializable {
    //    private static final long serialVersionUID = 40L;

    @Id
    @GeneratedValue
    Long id;

    @Property
    private int Line_Type;
    @Property
    private Set<String> Line_Id;
    @Property
    private String Station_Id;
    @Property
    private String Station_Name;
    @Property
    private int Sort;
    @Property
    private String[] LatLng;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Site site = (Site) o;
        return Objects.equals(Line_Id, site.Line_Id) && Objects.equals(Station_Id, site.Station_Id) && Objects.equals(Station_Name, site.Station_Name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(Line_Id, Station_Id, Station_Name);
    }

    public Site(int line_Type, String line_Id, String station_Id, String station_Name, int sort, String... latLng) {
        Line_Id = new HashSet<>();
        Line_Type = line_Type;
        Line_Id.add(line_Id);
        Station_Id = station_Id;
        Station_Name = station_Name;
        Sort = sort;
        LatLng = latLng;
    }

    public Site() {
        Line_Id = new HashSet<>();

    }

    @Override
    public String toString() {
        return "Site{" +
                "Line_Type=" + Line_Type +
                ", Line_Id=" + Arrays.toString(Line_Id.toArray()) +
                ", Station_Id='" + Station_Id + '\'' +
                ", Station_Name='" + Station_Name + '\'' +
                ", Sort=" + Sort +
                ", LatLng=" + LatLng +
                '}';
    }


    public void setLine_Type(int Line_Type) {
        this.Line_Type = Line_Type;
    }

    public int getLine_Type() {
        return Line_Type;
    }

    public void setLine_Id(String Line_Id) {
        this.Line_Id.add(Line_Id);
    }
    public void setLine_Id(String[] Line_Id) {
        this.Line_Id.addAll(List.of(Line_Id));
    }

    public Set<String> getLine_Id() {
        return Line_Id;
    }

    public void setStation_Id(String Station_Id) {
        this.Station_Id = Station_Id;
    }

    public String getStation_Id() {
        return Station_Id;
    }

    public void setStation_Name(String Station_Name) {
        this.Station_Name = Station_Name;
    }

    public String getStation_Name() {
        return Station_Name;
    }

    public void setSort(int Sort) {
        this.Sort = Sort;
    }

    public int getSort() {
        return Sort;
    }

    public void setLatLng(String... LatLng) {
        this.LatLng = LatLng;
    }

    public String[] getLatLng() {
        return LatLng;
    }
}
